//
//  RecordListController.m
//  AppNew
//
//  Created by 陈名邦 on 2019/6/29.
//  Copyright © 2019 华伟. All rights reserved.
//

#import "RecordListController.h"

@interface RecordListController ()

@end

@implementation RecordListController

- (void)viewDidLoad {
    [super viewDidLoad];
    _dataArr = [NSMutableArray array];
    [self initViews];
    
}

- (void)initViews{
    
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - NAVBAR_HEIGHT)];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableView];
    
}

#pragma mark -UITableViewDelegate,UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return _dataArr.count;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return nil;
    
}

- (void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear: animated];
    [self requestData];
    
}

- (void)requestData{
    
    NSString *url = [NSString stringWithFormat:_requestURL];
    [NetRequestTool get:url
                 params:nil
                success:^(id  _Nonnull json) {
                    
                    [SVProgressHUD showErrorWithStatus:@"加载失败"];
//                    self->_dataDic = json;
//                    if (self->_dataDic != nil) {
//
//                        self->_dataArr = [[self->_dataDic allKeys] mutableCopy];
//                        [self->_categoryTbl reloadData];
//
//                    }else{
//                        [SVProgressHUD showErrorWithStatus:@"加载失败"];
//                    }
                    
                    
                } failure:^(NSError * _Nonnull error) {
                    [SVProgressHUD showErrorWithStatus:@"加载失败"];
                }];
    
}



@end
